/*
 *  Copyright 2004 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.service.core;

import com.blandware.atleap.common.util.PartialCollection;
import com.blandware.atleap.common.util.QueryInfo;
import com.blandware.atleap.model.core.MailTemplate;

import java.util.Map;

/**
 * <p>Business Delegate (Proxy) Interface to handle communication between web and
 * persistence layer.
 * </p>
 * <p><a href="MailTemplateManager.java.html"><i>View Source</i></a>
 * </p>
 *
 * @author Sergey Zubtsovskiy <a href="mailto:sergey.zubtsovskiy@blandware.com">&lt;sergey.zubtsovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.4 $ $Date: 2006/08/03 10:07:41 $
 */
public interface MailTemplateManager extends BaseManager {

	/**
	 * Performs initialization of manager
	 */
	public void initialize();

	//~ CRUD Methods ================================================================

	/**
	 * Retrieves mail template with specified id
	 *
	 * @param templateId ID of template to retrieve
	 * @return Mail template or null if no mail template with specified ID exists in database
	 */
	public MailTemplate retrieveMailTemplate(Long templateId);

	/**
	 * Updates mail template
	 *
	 * @param mailTemplate  MailTemplate to update
	 * @param linkedObjects Map of pairs <code>uri -&gt; object<code>, which link URI in the body to
	 *                      corresponding object (resource or page) if it exists
	 */
	public void updateMailTemplate(MailTemplate mailTemplate, Map linkedObjects);


	// ~ Additional methods ================================================================

	/**
	 * Retrieves filtered/sorted collection of mail templates
	 *
	 * @param queryInfo Object that contains information about how to filter and sort data
	 * @return Collection of mail templates
	 */
	public PartialCollection listMailTemplates(QueryInfo queryInfo);

	// ~ Finders ================================================================

	/**
	 * Finds mail template with specified identifier
	 *
     * @param templateIdentifier identifier to search by
	 * @return Mail template with specified identifier or null if none was found
	 */
	public MailTemplate findMailTemplateByIdentifier(String templateIdentifier);


}
